/*
	Get/Push session
*/
var sessionVM = function () {
	var datacontext = new DataContext(),
		// Use in check expire session
        list = ko.observableArray([]),
		appRenewSession = function(callBackFunction) {
			list([]);
			datacontext.session.refreshToken({
				results: list
			}).done(function () {
                    CheckExpireSession(
                                       list,
                                       false,
                                       function() {
                                       /* nerver run this function */
                                       },
                                       function(entityResult) {
                                       model.homeVM.setUserInfoToLocal(null, entityResult, false);
                                       callBackFunction(true);
                                       });
				
			}).fail(function () {
				/* failed cause internet */
				callBackFunction(false);
			});
		};
		
	return {
        appRenewSession: appRenewSession
	};
}()
